<?php
/**
 * Template Name: moblegamestop10
 *
 * 
 * date:2011/10/14 
 * @author yuyue 
 * 
 */

$siteurl = get_bloginfo('template_url');
get_header();
?>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $siteurl?>/style/style-top10.css">

<div id="gametop_center">
		<span class="gametop-head"><b>TOP</b>10大手机游戏排行榜</span> 		 
		<div class="gametop-left">
			<span class="gametop-list">
            	<a href="http://www.youxisoso.com/top-flash-games">
					Flash小游戏
				</a>
            </span>
			<span class="gametop-list">
            	<a href="http://www.youxisoso.com/top-web-games" >
					网页游戏
				</a>
            </span> 
            <span class="gametop-list">
            	<a href="http://www.youxisoso.com/top-mobile-games" class="xz">
					手机游戏
				</a>
            </span> 
            <span class="gametop-list">
            	<a href="http://www.youxisoso.com/top-players">
					游戏达人排行榜
				</a>
            </span>  
		</div>
        <div class="game-right">
        	<?php
        		global $wpdb;
        		$sql_site = "select * from wp_posts where post_category_id=8 order by post_pi desc limit 0,10";
				$top_games = $wpdb->get_results ( $sql_site );
				$i=0;
				//$top_games = get_posts ( "orderby=post_pi&order=DESC&numberposts=10&category=8" );
				foreach ( $top_games as $post ){
					$i++;
					$gamePic = get_post_meta($post->ID, 'GamePic', true);
					$gametitle = $post->post_title;
					$game_url= $post->post_game_url;
					$game_category= $post->post_category_name;
					
        	?>
	        	 <div class="gametop10list">
	            	<div>
	                    <img src="<?php echo $siteurl ?>/images/top10/NO<?php echo $i ?>.gif"  class="No"  />
	                	<a href="<?php echo "/?p=".$post->ID;?>" ><img src="<?php echo $gamePic ?>" onerror="this.src='<?php echo $siteurl?>/images/onerror.jpg'" width="164" height="108" title="<?php echo $gametitle ?>" alt="<?php echo $gametitle ?>" /></a>
	                </div>
	                <span>游戏名称：</span>
	                <h3>
	                	<a href="<?php echo "/?p=".$post->ID;?>" ><?php echo $gametitle  ?></a>
	                </h3>
	                <span>类别：<?php echo $game_category ?></span>
	                <form>
	                	<input type="button" value=""  style="display:none;"/>
	                </form>
	            </div> 
        	<?php } ?>   
            
        </div>			 
	</div> 
<?php get_footer();?>